$OpenBSD: patch-texmf-dist_web2c_texmf_cnf,v 1.5 2017/05/21 11:57:51 edd Exp $
--- texmf-dist/web2c/texmf.cnf.origy	Thu May 12 23:56:32 2016
+++ texmf-dist/web2c/texmf.cnf	Thu Dec 29 20:55:14 2016
@@ -1,6 +1,10 @@
 % original texmf.cnf -- runtime path configuration file for kpathsea.
 % Public domain.
 % 
+% ************************
+% HACKED FOR OPENBSD PORTS
+% ************************
+% 
 % If you modify this original file, YOUR CHANGES WILL BE LOST when it is
 % updated.  Instead, put your changes -- and only your changes, not an
 % entire copy! -- in ../../texmf.cnf.  That is, if this file is
@@ -51,10 +55,9 @@
 % All trees must be organized according to the TeX Directory Structure
 % (http://tug.org/tds), or files may not be found.
 %
-% Redistributors will probably want $SELFAUTODIR/share, i.e., /usr/share.
-% Kpathsea sets SELFAUTOLOC (the directory with the binary),
-% SELFAUTODIR (its parent), and SELFAUTOPARENT (its grandparent).
-TEXMFROOT = $SELFAUTOPARENT
+% We use the old teTeX paths in OpenBSD, respect the legacy.
+OBSD_PREFIX= ${TRUEPREFIX}
+TEXMFROOT = $OBSD_PREFIX/share
 
 % The main tree of distributed packages and programs:
 TEXMFDIST = $TEXMFROOT/texmf-dist
@@ -64,7 +67,7 @@ TEXMFDIST = $TEXMFROOT/texmf-dist
 TEXMFMAIN = $TEXMFDIST
 
 % Local additions to the distribution trees.
-TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local
+TEXMFLOCAL = $TEXMFROOT/texmf-local
 
 % TEXMFSYSVAR, where *-sys store cached runtime data.
 TEXMFSYSVAR = $TEXMFROOT/texmf-var
@@ -443,7 +446,7 @@ LUAINPUTS.dvilualatex = .;$TEXMF/scripts/{$progname,$e
 LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luatex,plain,generic,}//
 
 % Lua needs to look for binary lua libraries distributed with packages.
-CLUAINPUTS = .;$SELFAUTOLOC/lib/{$progname,$engine,}/lua//
+CLUAINPUTS = .;$OBSD_PREFIX/lib/{$progname,$engine,}/lua//
 
 % Architecture independent executables.
 TEXMFSCRIPTS = $TEXMF/scripts/{$progname,$engine,}//
